import $http from "@/api/http";
import useUserStore from "@/store/modules/useUserStore";

function loadUserInfo() {
  const userStore = useUserStore();
  return $http
    .post("/yfs-user-service/v2/api/user/loadUserInfo", null, {
      loading: true
    })
    .then((res: any) => {
      if (res.code == 1000) {
        userStore.setUser(res.data);
      }
    });
}

export { loadUserInfo };
